<template>
  <swiper class="detail-swiper" v-if="swiperImages.length">
    <swiper-item class="swiper-item" v-for="(item, index) in swiperImages">
      <img :src="item" @load="imgLoad(index)">
    </swiper-item>
  </swiper>
</template>

<script>
  import Swiper from 'components/common/swiper/Swiper'
  import SwiperItem from 'components/common/swiper/SwiperItem'

  export default {
    name: "DetailSwiper",
    components: {SwiperItem, Swiper},
    props: {
      swiperImages: {
        type: Array,
        default() {
          return []
        }
      }
    },
    methods: {
      imgLoad(index) {
        if (index == this.swiperImages.length-1) {
          this.$emit('swiperImgLoad')
        }
      }
    }
  }
</script>

<style scoped>
  .detail-swiper {
    height: 450px;
  }
</style>
